package com.lingjtx.common.core.constant;

public enum OSSFolderName {

    // 存储对象文件位置
    DEFAULT(0, "app/default/"),  // 默认存储位置
    AVATAR(1, "app/avatar/"), // 头像
    LOGO(2, "app/logo/"), // 项目logo
    COMMON(3, "common/other/"),
    ICON(4, "app/icon/"),

    AI(5, "common/ai/"), // 故障报告单
    ;

    private int code;

    private String folder;

    OSSFolderName(int code, String folder) {
        this.code = code;
        this.folder = folder;
    }

    public int getCode() {
        return code;
    }

    public String getFolder() {
        return folder;
    }

    public static OSSFolderName codeOf(int code) {
        for (OSSFolderName ossFolderName : values()) {
            if (ossFolderName.getCode() == code) {
                return ossFolderName;
            }
        }
        return DEFAULT;
    }

    @Override
    public String toString() {
        return this.getFolder();
    }
}
